'use strict'

class collected {

  constructor () {
    //param默认就是/:id，若要改变路由，则可以设置此属性，比如设置为/:name
    //this.param = '/:id'
  }
  async post (c) {
    let sqltext = `INSERT INTO `
                + ` mycollection(open_id, collection_time, collection_text,collection_image,name,anothertext,type) `
                + ` VALUES ($1, $2, $3, $4, $5, $6, $7)`;
  

    let r = await c.service.psql.query(sqltext,[c.box.user.openid,c.body.collection_time,c.body.collection_text,c.body.collection_image,c.body.name,c.body.anothertext,c.body.type]);
    c.send(JSON.stringify(r.rows));
    console.log(r)
  }

}

module.exports = collected